﻿using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace DocumentorLog
{
    public class Logger
    {
        private static Logger _current;
        private static readonly ILog Log = LogManager.GetLogger(typeof(Logger));
 

        public static Logger Current
        { 
            get
            {
                if (_current == null)
                    _current = new Logger();
                return _current;
            }
        }

        private Logger()
        {
            log4net.Config.XmlConfigurator.Configure();
        }
        public void Debug(string Message)
        {
            Log.Debug(Message);
            
        }

        public void Debug(string Message,Exception ex)
        {
            Log.Debug(Message, ex);
        }

        public void Info(string Message)
        {
            Log.Info(Message);
        }
        public void Warn(string Message)
        {
            Log.Warn(Message);
        }
        public void Error(string Message)
        {
            Log.Error(Message);
        }
        public void Fatal(string Message)
        {
            Log.Fatal(Message);
        }



        public void Info(string Message, Exception ex)
        {
            Log.Info(Message,ex);
        }
        public void Warn(string Message, Exception ex)
        {
            Log.Warn(Message, ex);
        }
        public void Error(string Message, Exception ex)
        {
            Log.Error(Message, ex);
        }
        public void Fatal(string Message, Exception ex)
        {
            Log.Fatal(Message, ex);
        }

    }
}
